'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const UserSchema = new Schema({
    name: { type: String },
    code: { type: String },
    loginname: { type: String },
    user_info: { type: Schema.Types.Mixed },
    openid: { type: String },
    source: { type: String },
    session_key: { type: String },
    pass: { type: String },
    email: { type: String },
    url: { type: String },
    location: { type: String },
    avatar: { type: String },
    room_id: { type: String },
    accessToken: { type: String }
  });

  return mongoose.model('User', UserSchema);
};